/*
 * FaceTextPainter.h
 *
 *  Created on: 2018年8月13日
 *      Author: zhengboyuan
 */

#ifndef FACETEXTPAINTER_H_
#define FACETEXTPAINTER_H_

#include "BasicType.h"
#include "MediaType.h"
#include "FaceText.h"

#include "MutableFont.h"
#include "MutablePen.h"



class FaceTextPainter
{
public:
	static bool SHOW_PTS;

public:
    FaceTextPainter();
    virtual ~FaceTextPainter();

	void setText(const std::string& text, int64_t pts, int duration, int flags);

	void draw(HWND hwnd, HDC hdc, const RECT& rcWin, const RECT& rcDest, int width, int height, int64_t pts);

	bool isEmpty();

	int64_t getPts();
	int64_t getExpiredPts();

	void clear();

protected:
	void drawRect(HDC hdc, const RECT& rc);

	FaceText::Face mapCoord(const FaceText::Face& face, const RECT& rcWin, const RECT& rcDest, int width, int height);

protected:
	FaceText	m_faceText;

	int64_t		m_pts;
	int64_t		m_duration;
	int64_t		m_expiredPts;

	MutablePen m_pen;
	MutableFont	m_font;
	MutableFont	m_textFont;

};

#endif /* FACETEXTPAINTER_H_ */
